<template>
	<view class="page">
		<up-navbar title="销售人员信息" :autoBack="true" safeAreaInsetTop placeholder> </up-navbar>
		
		<view class="xiangmujs"  style=" margin-top: 20rpx;">
			<view class="juzong"  >
				<!-- <view  class="fudongs" >
					<view class="biao" ></view>
					<view style="margin-left: 20rpx; font-weight: 900; font-size: 40rpx; " ><text>下单信息</text></view>
					
				</view> -->
				<view style=" color: #666666; padding-bottom: 20rpx;">
					<view style="display: flex; margin-top: 20rpx;">
						<view style="margin-left: 20rpx; width: 30%"><text>姓名:</text></view>
						<view style="margin-left: 20rpx; width: 70%"><text>{{neirong.nickname}}</text></view>
					</view>
					<view style="display: flex; margin-top: 20rpx;">
						<view style="margin-left: 20rpx; width: 30%"><text>账号:</text></view>
						<view style="margin-left: 20rpx; width: 70%"><text>{{neirong.username}}</text></view>
					</view>
					<!-- <view style="display: flex; margin-top: 20rpx;">
						<view style="margin-left: 20rpx; width: 30%"><text>密码:</text></view>
						<view style="margin-left: 20rpx; width: 70%"><text>a2345678</text></view>
					</view> -->
				
					<view style="display: flex; margin-top: 20rpx;">
						<view style="margin-left: 20rpx; width: 30%"><text>联系电话:</text></view>
						<view style="margin-left: 20rpx; width: 70%"><text>1239878876</text></view>
					</view>
					<view style="display: flex; margin-top: 20rpx;">
						<view style="margin-left: 20rpx; width: 30%"><text>个人简介:</text></view>
						<view style="margin-left: 20rpx; width: 70%"><text>{{neirong.desc}}</text></view>
					</view>
					<view style="display: flex; margin-top: 20rpx;">
						<view style="margin-left: 20rpx; width: 30%"><text>地址:</text></view>
						<view style="margin-left: 20rpx; width: 70%"><text>{{neirong.full_address}}</text></view>
					</view>
					
				
				</view>
			</view>
		</view>
		
		<view style="  position: fixed;  bottom: 10rpx; width: 90%; left: 5%;" v-if="user_type==1||user_type==2">
			<view style="width: 90%; margin: 0 auto;  margin-top: 50rpx; margin-bottom: 20rpx; ">
				<view><up-button class="custom-style" shape="circle" color="#FF6A04" text="资料编辑" @click="baocun"></up-button></view>
			
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				sale_id:'',
				neirong:'',
				user_type:'',
			}
		},
		onLoad(id) {
			console.log(id)
			this.sale_id= parseInt(id.id)
			this.fenhong()
			this.getUserData()
			// var insg = uni.getStorageSync('userinfo')
			// this.user_type=insg.user_type
			// var data = JSON.parse(decodeURIComponent(options.options))
			
			// if(data.id!=null){
			// 	this.tite='编辑销售'
			// }else{
			// 	this.tite='添加销售'
			// }
		},
		onShow() {
			this.fenhong()
			
			this.getUserData()
			},
		methods: {
			getUserData() {
				console.log(121213)
				this.$request({
					url: 'api/User/getUserInfo',
					header: "application/x-www-form-urlencoded",
					data: {}
				}).then(res => {
					if (res.code == 1) {
						console.log(res.data.user_type,'res')
						this.user_type=res.data.user_type
					} 
				})
				
			},
		fenhong() {
		
		
			
			this.$request({
				url: '/api/User/getMySaleDetail',
				header: "application/x-www-form-urlencoded",
				data: {
					sale_id: this.sale_id,
				
				}
			}).then(res => {
				if (res.code == 1) {
					console.log(res)
					this.neirong=res.data
				} else {
		
		
				}
			})
		
		},
			baocun(){
				var data={
					id:this.neirong.id
				}
			var jisng =	encodeURIComponent(JSON.stringify(data))
			
				uni.navigateTo({
				       
					
						 url: '/pages/my/xiao_liang/add_xiaoliang/add_xiaoliang?options='+jisng
				      });
				
			},
		}
	}
</script>

<style lang="scss" scoped>
.page {
		background: #F8F8F8;
	}
	.xiangmujs{
		width: 95%; margin: 0 auto; background-color: #fff; border-radius: 20rpx;
	}
	.juzong{
	    width: 90%;
	    margin: 0 auto;
	    margin-top: 20rpx;
	    padding-top: 20rpx;
	    padding-bottom: 20rpx;
	}
</style>
